﻿using CatUtils.Utils.Currency.IoUtils;
using CatUtils.Utils.SpecialUtils.View;
using RabbitDownload.ViewcCntrol;
using RabbitDownload.WebSite.Local.AutoPic;
using RabbitDownload.WebSite.Local.TagManger;
using System;
using System.Windows.Forms;

namespace RabbitDownload.WebSite.Local
{
    public partial class LocalToolControl : UserControl
    {
        public LocalToolControl()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            AddFilePath(textBox1);
        }

        private void AddFilePath(TextBox Tbox)
        {
            string FilePath = FileHelper.SelectFile();
            if (FilePath != "")
                Tbox.Text = FilePath;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            AddFilePath(textBox2);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            new LocalTagManger().ZerochanMarge(textBox1.Text, textBox2.Text);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Groupboxhelper.Replace(ComboboxSelectChange.LocalGroupBox, new WebSite.RomeSound.RomeSoundControl());
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Groupboxhelper.Replace(ComboboxSelectChange.LocalGroupBox, new MangerTool.MangerToolingControl());
        }

        private void button7_Click(object sender, EventArgs e)
        {
            Groupboxhelper.Replace(ComboboxSelectChange.LocalGroupBox, new MangerTool.DownloadControl());
        }

        private void button6_Click(object sender, EventArgs e)
        {
            string FileName = FileHelper.SelectFile();
            if (FileName != "")
            {
                textBox3.Text = FileName;
                FileHelper.WriteText(AutoPicHelper.SainSystemTextPath, FileName);
            }
        }
    }
}